#!/bin/sh

# parameter:
# 1: dbc_package
# 2: action
# 3: if action = configure: most-recently-configured-version

dbc_confdir="/etc/dbconfig-common"
dbc_share="/usr/share/dbconfig-common"
dbc_package="susan-database-common"

dbc_packageconfig="$dbc_confdir/$dbc_package.conf"

dbversion=`basename $0`

template="/usr/lib/susan/scripts/ddl/grants/postgresql-change_owner.dbconfig-template.sql"
target="/var/lib/susan/dbconfig-common/upgrade-dbadmin/pgsql/$dbversion"

/usr/sbin/dbconfig-generate-include -f template -o template_infile=$template $dbc_packageconfig > $target

